//
//  ClassLanguageCollectViewController.m
//  Ai
//
//  Created by 杜超男 on 2019/3/6.
//  Copyright © 2019年 杜超男. All rights reserved.
//

#import "ClassLanguageCollectViewController.h"
#import "XLSlideSwitch.h"//滑动滚动第三方
#import "PositiveLanguageViewController.h"//正规语言
#import "IllegalLanguageWarningViewController.h"//违规语言告警
#import "ClassLanguageSummaryViewController.h"//安静指数
#import "Masonry.h"
@interface ClassLanguageCollectViewController ()<XLSlideSwitchDelegate>
@property (nonatomic , strong)XLSlideSwitch *ScrollView;///滚动视图

@end

@implementation ClassLanguageCollectViewController
-(void)viewWillAppear:(BOOL)animated{
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.view.bounds;
    maskLayer.path = maskPath.CGPath;
    self.view.layer.mask = maskLayer;
    /*
     #import "PositiveLanguageViewController.h"//正规语言
     #import "IllegalLanguageWarningViewController.h"//违规语言告警
     #import "ClassLanguageSummaryViewController.h"//班级语言汇总
     */
    //创建一个数组用来存储名字
    NSArray *TitlesArr = @[@"正向语言" , @"违规语言告警" , @"安静指数"];
    NSArray *ControllersArr = @[@"PositiveLanguageViewController" , @"IllegalLanguageWarningViewController" , @"ClassLanguageSummaryViewController"];
    NSMutableArray *ViewControllers = [[NSMutableArray alloc] init];
    for (int i = 0 ; i < TitlesArr.count; i ++) {
        //字符串创建控制器
        UIViewController *VC = [[NSClassFromString(ControllersArr[i])alloc] init];
        [ViewControllers addObject:VC];
    }
    //滚动视图
    _ScrollView = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 16, self.view.bounds.size.width, self.view.bounds.size.height - 64) Titles:TitlesArr viewControllers:ViewControllers];
    _ScrollView.delegate = self;
    //rgba(102/255.0, 102, 102, 1)
    _ScrollView.itemNormalColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1];
    //rgba(72/255.0, 169/255.0, 54/255.0, 1)
    _ScrollView.itemSelectedColor = [UIColor colorWithRed:72/255.0 green:169/255.0 blue:54/255.0 alpha:1];
    _ScrollView.customTitleSpacing = 30;
    _ScrollView.hideShadow=YES;
    [_ScrollView showInViewController:self];
    _ScrollView.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];
    [_ScrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).inset(16);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(-0);
    }];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
